import request from '@/utils/request'

// 查询分类列表
export function listCategory(query) {
  return request({
    url: '/product/category/list',
    method: 'get',
    params: query
  })
}

// 查询分类详细
export function getCategory(productCategoryId) {
  return request({
    url: '/product/category/' + productCategoryId,
    method: 'get'
  })
}

// 新增分类
export function addCategory(data) {
  return request({
    url: '/product/category',
    method: 'post',
    data: data
  })
}

// 修改分类
export function updateCategory(data) {
  return request({
    url: '/product/category',
    method: 'put',
    data: data
  })
}

// 删除分类
export function delCategory(productCategoryId) {
  return request({
    url: '/product/category/delete/' + productCategoryId,
    method: 'delete'
  })
}
// 批量删除分类
export function delAllCategory(productCategoryIds) {
  return request({
    url: '/product/category/' + productCategoryIds,
    method: 'delete'
  })
}

// 获取分类产品菜单下拉列表
export function productMenuSelectList() {
  return request({
    url: '/product/menu/selectList',
    method: 'get'
  })
}


// 查询品牌列表
export function listBrand(query) {
  return request({
    url: '/product/brand/list',
    method: 'get',
    params: query
  })
}

// 查询品牌详细
export function getBrand(brandId) {
  return request({
    url: '/product/brand/' + brandId,
    method: 'get'
  })
}

// 新增品牌
export function addBrand(data) {
  return request({
    url: '/product/brand',
    method: 'post',
    data: data
  })
}

// 修改品牌
export function updateBrand(data) {
  return request({
    url: '/product/brand',
    method: 'put',
    data: data
  })
}
//删除品牌
export function delBrand(brandId) {
  return request({
    url: '/product/brand/delete/' + brandId,
    method: 'delete'
  })
}

// 批量删除品牌
export function delAllBrand(productBrandIds) {
  return request({
    url: '/product/brand/' + productBrandIds,
    method: 'delete'
  })
}

// 查询代理商列表
export function listAgency(query) {
  return request({
    url: '/product/agency/list',
    method: 'get',
    params: query
  })
}
// 新增代理商
export function addAgency(data) {
  return request({
    url: '/product/agency',
    method: 'post',
    data: data
  })
}
// 查询代理商详细
export function getAgency(generalAgencyId) {
  return request({
    url: '/product/agency/' + generalAgencyId,
    method: 'get'
  })
}
// 修改代理商
export function updateAgency(data) {
  return request({
    url: '/product/agency',
    method: 'put',
    data: data
  })
}

//删除总代理商
export function delAgency(generalAgencyId) {
  return request({
    url: '/product/agency/delete/' + generalAgencyId,
    method: 'delete'
  })
}

// 批量删除总代理商
export function delAllAgency(generalAgencyIds) {
  return request({
    url: '/product/agency/' + generalAgencyIds,
    method: 'delete'
  })
}

// 获取总代理下拉列表
export function agencySelectlist() {
  return request({
    url: '/product/agency/selectlist',
    method: 'get',
  })
}

// 获取分类下拉列表
export function categorySelectList() {
  return request({
    url: '/product/category/selectList',
    method: 'get',
  })
}
// 获取品牌下拉列表
export function brandSelectList() {
  return request({
    url: '/product/brand/selectList',
    method: 'get',
  })
}

// 查询产品详情菜单列表
export function listMenu(query) {
  return request({
    url: '/product/menu/list',
    method: 'get',
    params: query
  })
}

// 查询分类产品菜单详细
export function getMenu(detailsMenuId) {
  return request({
    url: '/product/menu/' + detailsMenuId,
    method: 'get'
  })
}

// 新增分类产品菜单
export function addMenu(data) {
  return request({
    url: '/product/menu',
    method: 'post',
    data: data
  })
}

// 修改分类产品菜单
export function updateMenu(data) {
  return request({
    url: '/product/menu',
    method: 'put',
    data: data
  })
}

// 删除分类产品菜单
export function delMenu(menuId) {
  return request({
    url: '/product/menu/delete/' + menuId,
    method: 'delete'
  })
}
// 批量删除分类产品菜单
export function delAllMenu(menuIds) {
  return request({
    url: '/product/menu/' + menuIds,
    method: 'delete'
  })
}

// 获取产品列表
export function listProduct(query) {
  return request({
    url: '/product/product/listByContentUser',
    method: 'get',
    params: query
  })
}


// 查询产品详细
export function getProduct(productId) {
  return request({
    url: '/product/product/' + productId,
    method: 'get'
  })
}

// 新增产品
export function addProduct(data) {
  return request({
    url: '/product/product',
    method: 'post',
    data: data
  })
}

// 修改产品
export function updateProduct(data) {
  return request({
    url: '/product/product',
    method: 'put',
    data: data
  })
}

// 删除产品
export function delProduct(productId) {
  return request({
    url: '/product/product/delete/' + productId,
    method: 'delete'
  })
}
// 批量删除产品
export function delAllProduct(productIds) {
  return request({
    url: '/product/product/' + productIds,
    method: 'delete'
  })
}
// 获取产品详情数组
export function getProductDetail(data) {
  return request({
    url: '/product/product/productDetail',
    method: 'post',
    data: data
  })
}
// 获取产品审核列表
export function listAuditlist(query) {
  return request({
    url: '/product/product/auditlist',
    method: 'get',
    params: query
  })
}
// 获取产品审核详情
export function getAuditInfo(productId) {
  return request({
    url: '/product/product/auditInfo/' + productId,
    method: 'get'
  })
}
// 产品审核
export function auditProduct(query) {
  return request({
    url: '/product/product/auditProduct',
    method: 'get',
    params: query
  })
}

// 新增轮播图
export function addBanner(data) {
  return request({
    url: '/product/banner',
    method: 'post',
    data: data
  })
}
//轮播图列表
export function listBanner(query) {
  return request({
    url: '/product/banner/list',
    method: 'get',
    params: query
  })
}

// 修改轮播图
export function updateBanner(data) {
  return request({
    url: '/product/banner',
    method: 'put',
    data: data
  })
}
//获取轮播图列表详情
export function getBanner(brandId) {
  return request({
    url: '/product/banner/' + brandId,
    method: 'get'
  })
} 

// 批量删除轮播图
export function delAllBanner(productBrandIds) {
  return request({
    url: '/product/banner/' + productBrandIds,
    method: 'delete'
  })
}
